-- card: 4255 from stack: in.3 -- bmap block id: 9835 -- flags: 4000 -- background id: 2663 -- name: Click Select -- part 1 (field) -- low flags: 01 -- high flags: 4000 -- rect: left=285 top=31 right=137 bottom=327 -- title width / last selected line: 0 -- icon id / first selected line: 0 / 0 -- text alignment: 1 -- font id: 3 -- text size: 12 -- style flags: 256 -- line height: 13 -- part name: Click select 1 ----- HyperTalk script ----- on copyright -- Click Select, Copyright by Mac Help Co., January 1988 -- by Chris Hostetter, Mac Help Co., 1800 East Market Street -- Long Beach, CA 90805, (213) 428-7414 -- The script for this button is copyrighted and may not be -- used without the written permission of the author (above). end copyright on mouseUp Global ThisItem, ThisLine, ThisField -- NOTE: THIS BUTTON CAN ALSO USE A HILITER BUTTON. SIMPLY CREATE -- A NEW BUTTON ON THE SAME CARD OR BACKGROUND THAT THIS FIELD IS ON. -- NAME THE BUTTON 'HILIGHTER' AND SET THE BUTTON TO TRANSPARENT -- put false into UseHilighter (below) if you don't want a hilighter put True into UseHilighter set numberformat to 0 put the clickLoc into ThisMouseLoc set cursor to 4 put the name of the target into WhatField put first word of WhatField into StackLocation put the rect of whatField into FieldRect put item 1 of FieldRect into X -- Left of Rect put item 2 of FieldRect into Y -- Top of Rect put item 3 of FieldRect into XX -- Right of Rect put item 4 of FieldRect into YY -- Bottom of Rect put (YY - Y) / the textheight of whatField into TotalZones put (YY - Y) / TotalZones into ZoneDepth put item 2 of ThisMouseLoc - Y into MouseDepth put the trunc of ((MouseDepth / ZoneDepth) + 1) into whichZone if the style of whatField is "Scrolling" then put the scroll of whatField / the textHeight of whatField into HiddenLines else put 0 into HiddenLines end if put the round of HiddenLines into HiddenLines put whichZone + HiddenLines into ThisLine do "put line" && ThisLine && "of" && whatField && "into ThisItem" if UseHilighter is true then --MOVE HILIGHTER BUTTON TO PROPER ZONE put Y + ((whichZone-1)*ZoneDepth) into ButY put the trunc of ButY into ButY put the trunc of (ButY+ZoneDepth) into ButYY if StackLocation is "Card" then if the style of whatField is "Scrolling" then set the rect of Card button "Hilighter" to X+1,ButY+1,XX-17,ButYY-1 else set the rect of Card button "Hilighter" to X+1,ButY+1,XX-1,ButYY-1 end if set the hilite of Card button "Hilighter" to true show Card button "Hilighter" Hide Card button "Hilighter" else if the style of whatField is "Scrolling" then set the rect of background button "Hilighter" to X+1,ButY+1,XX-17,ButYY-1 else set the rect of background button "Hilighter" to X+1,ButY+1,XX-1,ButYY-1 end if set the hilite of background button "Hilighter" to true show background button "Hilighter" Hide background button "Hilighter" end if end if -- Do something to selected line if ThisItem is empty then -- Put whatever you want into the field when it is clicked put "XXX" into PutStuff do "put" && PutStuff && "into line" && ThisLine && "of" && whatField else do "put empty into line" && ThisLine && "of" && whatField end if -- end doing something to selected line end mouseUp -- part 2 (button) -- low flags: 80 -- high flags: 4000 -- rect: left=286 top=110 right=121 bottom=326 -- title width / last selected line: 0 -- icon id / first selected line: 0 / 0 -- text alignment: 1 -- font id: 0 -- text size: 12 -- style flags: 0 -- line height: 16 -- part name: Hilighter -- part 3 (field) -- low flags: 00 -- high flags: 4000 -- rect: left=328 top=31 right=137 bottom=493 -- title width / last selected line: 0 -- icon id / first selected line: 0 / 0 -- text alignment: 0 -- font id: 3 -- text size: 12 -- style flags: 0 -- line height: 13 -- part name: Click select 1 -- part 4 (button) -- low flags: 00 -- high flags: A005 -- rect: left=290 top=146 right=168 bottom=498 -- title width / last selected line: 0 -- icon id / first selected line: 0 / 0 -- text alignment: 1 -- font id: 0 -- text size: 12 -- style flags: 0 -- line height: 16 -- part name: SHOW the Hilighter Button ----- HyperTalk script ----- on mouseUp put the name of the target into ThisName if the visible of card button "Hilighter" is true then hide card button "Hilighter" set the name of ThisName to "SHOW the Hilighter Button" else show card button "Hilighter" set the name of ThisName to "HIDE the Hilighter Button" end if end mouseUp -- part 5 (field) -- low flags: 01 -- high flags: 0004 -- rect: left=265 top=20 right=35 bottom=325 -- title width / last selected line: 0 -- icon id / first selected line: 0 / 0 -- text alignment: 1 -- font id: 3 -- text size: 9 -- style flags: 0 -- line height: 12 -- part name: ----- HyperTalk script ----- on mouseUp edit script of card field "Click Select 1" end mouseUp -- part contents for background part 8 ----- text ----- Card 10 of 20 -- part contents for card part 1 ----- text ----- XXX XXX XXX XXX -- part contents for card part 3 ----- text ----- Eggs Butter Flower Salt Pepper This Item This Item This Item -- part contents for background part 9 ----- text ----- CLICK SELECT When you click on the field, it automatically puts XXX into the field to mark it. This type of marker is very useful because it is a field, and if used on the background, it will work on every card and retain its own settings from card to card. You can resize this field to hold only one item, or as many as needed. Currently, the script is set to put XXX into the line that is clicked on, but you can change it to whatever you want. -- part contents for card part 5 ----- text ----- See Script